/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-03-20
 * Time: 12:48
 */
class myThread extends Thread{
    @Override
    public void run() {
       while (true){
           System.out.println("新线程");
           try {
               Thread.sleep(100);
           } catch (InterruptedException e) {
               throw new RuntimeException(e);
           }
       }
    }
}
public class tesst1 {
    public static void main(String[] args) {
        myThread t =new myThread();
        t.start();
        try {
            t.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        while (true){
            System.out.println("Main线程");
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
